package com.ziyun.pop.mall.module.time.dao;

import com.service.db.conf.DataSourceEnum;
import com.service.db.conf.DynamicDataSource;
import com.service.db.dao.impl.BaseDaoImpl;
import com.utility.New;
import com.ziyun.pop.mall.module.time.mapper.PopUserActionMapper;
import com.ziyun.pop.mall.module.user.entity.PopUserAction;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author:chenxiaoyi
 * @Date:2018/11/6 13:50
 */
@Repository
public class PopUserActionDao extends BaseDaoImpl<PopUserActionMapper,PopUserAction> {

    public  List<PopUserAction> selectAll() {
        List<PopUserAction>  popUserActions= New.arrayList();
        try {
            DynamicDataSource.setDataSource(DataSourceEnum.SLAVE.getName());
            popUserActions = baseMapper.selectAll();
        } finally {
            DynamicDataSource.clearDataSource();
        }
        return popUserActions;
    }
}
